#include <stdlib.h>
#include <stdio.h>
#include "../lib/url.h"

int main(int argc, char* argv[])
{
	if(2 <= argc)
	{
		char	domain[128]		= {0};

		url_get_domain(argv[1], domain);
		printf("domain: %s\n", domain);
		return 0;
	}

	do
	{
		char	url[512]		= {0};
		char	domain[128]		= {0};

		printf(">");
		if(NULL == gets(url))
		{
			break;
		}
		if(strcmp(url, "exit") == 0)
		{
			break;
		}
		url_get_domain(url, domain);
		printf("domain: %s\n", domain);
	}while(1);

	return 0;
}
